package map_set;

import java.util.*;

//448. 找到所有数组中消失的数字
public class Num484_findDisappearedNumbers {
    public List<Integer> findDisappearedNumbers(int[] nums) {
        List<Integer> list = new ArrayList<>();
        Set<Integer> map = new HashSet<>();
        for (int n : nums) {
            map.add(n);
        }

        for (int i = 1; i <= nums.length; i++) {
            if (!map.contains(i)){
                list.add(i);
            }
        }

       return list;
    }

    public static void main(String[] args) {

    }
}
